<?php
// DIC configuration

$container = $app->getContainer();

// monolog
$container['logger'] = function ($c) {
    $settings = $c->get('settings')['logger'];
    $logger = new Monolog\Logger($settings['name']);
    $logger->pushProcessor(new Monolog\Processor\UidProcessor());
    $logger->pushHandler(new Monolog\Handler\StreamHandler($settings['path'], $settings['level']));
    return $logger;
};


$container['purifier'] = function($c) {
    $config = HTMLPurifier_Config::createDefault();
    $config->set('AutoFormat', 'RemoveEmpty', true);
    $config->set('AutoFormat', 'RemoveSpansWithoutAttributes', true);
    $purifier = new HTMLPurifier($config);
    return $purifier;
};


